package com.laundry.controller.admin;

import com.laundry.dto.ResultDTO;
import com.laundry.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/admin/message")
public class AdminMessageController {

    @Autowired
    private MessageService messageService;

    @PostMapping("/send")
    public ResultDTO sendMessage(@RequestParam Long userId, 
                              @RequestParam String title, 
                              @RequestParam String content) {
        System.out.println("管理员发送消息: 用户ID=" + userId + ", 标题=" + title); // 调试信息
        return messageService.sendMessage(userId, title, content);
    }
} 